#include "stdafx.h"
#include "wf_blockstoggleview.h"

#include "pf_graphic.h"



WF_BlocksToggleView::WF_BlocksToggleView(
    PF_Container& container,
    PF_GraphicView& graphicView)
        :PF_ActionInterface("Toggle Block Visibility",
                    container, graphicView) {}


QAction* WF_BlocksToggleView::createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/) {
//  	QAction* action = new QAction(tr("Toggle Block Visibility"),
//								  tr("&Toggle Block"),
//								  QKeySequence(), NULL);
	
	QAction* action = new QAction(tr("Toggle Block Visibility"),  NULL);
	//action->zetStatusTip(tr("Toggle Block"));

		return action;
}


void WF_BlocksToggleView::trigger() {
    PF_DEBUG->print("toggle block");
    if (graphic!=NULL) {
        PF_Block* block = graphic->getActiveBlock();
        graphic->toggleBlock(block);
    }
	graphicView->redraw(LX_Define::RedrawDrawing); 

    finish();
}



void WF_BlocksToggleView::init(int status) {
    PF_ActionInterface::init(status);
    trigger();
}

// EOF
